package com.ikingtech.framework.sdk.label.api;

import com.ikingtech.framework.sdk.core.response.R;
import com.ikingtech.framework.sdk.label.model.LabelAssignDTO;
import com.ikingtech.framework.sdk.label.model.LabelQueryParamDTO;
import com.ikingtech.framework.sdk.web.annotation.PostRequest;
import com.ikingtech.framework.sdk.label.model.LabelDTO;
import io.swagger.v3.oas.annotations.Parameter;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author tie yan
 */
public interface LabelApi {

    @PostRequest(order = 1, value = "/add", summary = "新增", description = "新增，新增成功后返回编号。")
    R<String> add(@Parameter(name = "label", description = "标签信息")
                  @RequestBody LabelDTO label);

    @PostRequest(order = 2, value = "/delete", summary = "删除", description = "删除。")
    R<Object> delete(@Parameter(name = "id", description = "编号")
                     @RequestBody String id);

    @PostRequest(order = 3, value = "/update", summary = "更新", description = "更新。")
    R<Object> update(@Parameter(name = "label", description = "标签信息")
                     @RequestBody LabelDTO label);

    @PostRequest(order = 3, value = "/assign", summary = "标签分配", description = "更新。")
    R<Object> assign(@Parameter(name = "post", description = "标签信息")
                     @RequestBody LabelAssignDTO labelAssign);

    @PostRequest(order = 4, value = "/list/page", summary = "分页查询", description = "分页查询，没有查询结果时返回空列表。")
    R<List<LabelDTO>> page(@Parameter(name = "queryParam", description = "查询条件")
                          @RequestBody LabelQueryParamDTO queryParam);

    @PostRequest(order = 5, value = "/list/all", summary = "全量查询", description = "全量查询，没有查询结果时返回空列表。")
    R<List<LabelDTO>> all();

    @PostRequest(order = 6, value = "/detail/id", summary = "查询详情", description = "查询详情，数据不存在时仍然返回成功,数据为null。")
    R<LabelDTO> detail(@Parameter(name = "id", description = "编号")
                      @RequestBody String id);
}
